package com.sky.controller.admin;


import com.sky.result.Result;
import com.sky.service.ShopService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController("adminShopController")
@RequestMapping("/admin/shop")
@Slf4j
public class ShopController {
    @Autowired
    ShopService shopService;

    /**
     * admin营业状态设置
     * @param status
     * @return
     */
    @PutMapping("{status}")
    public Result updateStatus(@PathVariable Integer status){
        log.info("admin营业状态设置{}",status);
        return shopService.updateStatus(status);
    }

    /**
     * 查看营业状态
     * @return
     */
    @GetMapping("/status")
    public Result getStatus(){
        log.info("admin营业状态查看");
        return shopService.getStatus();
    }
}




